<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('消息提醒记录列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>域名信息：</label>
                                <input type="text" name="domainTxt"/>
                            </li>
                            <li>
                                <label>消息类型：</label>
                                <select name="msgType" th:with="type=${@dict.getType('msg_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>通知渠道：</label>
                                <select name="receiveType" th:with="type=${@dict.getType('msg_receive_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>状态：</label>
                                <select name="status">
                                    <option value="">所有</option>
                                    <option value="0">发送成功</option>
                                    <option value="1">发送失败</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="SSL:warnLog:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="SSL:warnLog:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>-->
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="SSL:warnLog:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="SSL:warnLog:export">
                    <i class="fa fa-download"></i> 导出
                </a>-->
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('SSL:warnLog:edit')}]];
        var removeFlag = [[${@permission.hasPermi('SSL:warnLog:remove')}]];
        var msgTypeDatas = [[${@dict.getType('msg_type')}]];
        var receiveTypeDatas = [[${@dict.getType('msg_receive_type')}]];
        var prefix = ctx + "SSL/notificationLog";
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "消息提醒记录",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'Id',
                    visible: false
                },
                {
                    field: 'domainTxt',
                    title: '域名信息'
                },
                {
                    field: 'msgType',
                    title: '消息类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(msgTypeDatas, value);
                    }
                },
                {
                    field: 'receiveType',
                    title: '通知渠道',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(receiveTypeDatas, value);
                    }
                },
                {
                    field: 'msgTitle',
                    title: '消息标题'
                },
                {
                    field: 'msgContent',
                    title: '消息内容'
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function(value, row, index) {
                        var tmpHtml="";
                        if(value){
                            if(value === "0"){
                                tmpHtml= '<span class="badge badge-success">发送成功</span>';
                            }else {
                                tmpHtml= '<span class="badge badge-danger">发送失败</span>';
                            }
                        }else{
                            tmpHtml= '<span class="badge badge-danger">-</span>';
                        }
                       return tmpHtml;
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
